class Race {
	String name
	Date startDateTime
	String city
	String state
	Float distance
	Float cost
	Integer maxRunners = 10

	static hasMany = [registrations : Registration]
	static constraints = {
		name(maxLength:50,blank:false)
		startDateTime(validator:{return (it > new Date())})
		city(maxLength:300,blank:false)
		state(inList:['hi','yn','gd','sc','gx'],blank:false)
		distance(min:3.0f,max:100f)
		cost(min:0f,max:999.99f)
		maxRunners(min:10,max:1000)
	}

	String toString()
	{
		"${this.name} : ${this.city},${this.state}"
	}
}
